// This program produces the Pearson correlation coefficients for TABLE 3

// LS&D (2014)
clear
use "\\file\UsersW$\wrr15\Home\My Documents\My Files\PCC PROJECT\DATAVERSE FILES\TABLE1.dta"
gen telasticity = estimatedelasticity/se
gen precision = 1/se
gen tstat = telasticity
gen pcc = tstat/sqrt(tstat^2+df)
gen varpcc = (1-pcc^2)/df
gen sepcc = sqrt(varpcc)
gen tpcc = pcc/sepcc
gen precisionpcc = 1/sepcc
pwcorr precision precisionpcc, sig

// HAVRANEK (2015)
clear
use "\\file\UsersW$\wrr15\Home\My Documents\My Files\PCC PROJECT\DATAVERSE FILES\TABLE2.dta"
gen tstat = eis/se
gen prec = 1/se
gen df = obs
gen pcc = tstat/sqrt(tstat^2+df)
gen varpcc = (1-pcc^2)/df
gen sepcc = sqrt(varpcc)
gen tpcc = pcc/sepcc
gen precisionpcc = 1/sepcc
pwcorr prec precisionpcc, sig